package com.ramnight.unify.kit.exception;

import lombok.Getter;
import lombok.ToString;

@ToString
public class UnifyException extends RuntimeException {
	private static final long serialVersionUID = 1L;

	@Getter
	private int code;
	@Getter
	private String msg;

	public UnifyException(int code) {
		super();
		this.code = code;
	}

	public UnifyException(int code, Exception e) {
		super(e);
		this.code = code;
		this.msg = ExceptionUtil.getDescription(e);
	}

	public UnifyException(int code, String msg) {
		super(msg);
		this.code = code;
		this.msg = msg;
	}

	public UnifyException(int code, String msg, Exception e) {
		super(msg, e);
		this.code = code;
		this.msg = msg;
	}

	public UnifyException(String msg) {
		super(msg);
		this.msg = msg;
	}

	public UnifyException(Exception e) {
		super(e);
		this.msg = ExceptionUtil.getDescription(e);
	}

	public UnifyException(String msg, Exception e) {
		super(msg, e);
		this.msg = msg;
	}
}
